package me.cloudcat.develop.websocket;

import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;

/**
 * 创建websocket处理类（非注解模式）
 * 
 * @author ZZWang
 * @Time 2017年3月17日 上午11:24:15
 */
public class WebsocketEndPoint extends TextWebSocketHandler {

	@Override
	protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
		// TODO Auto-generated method stub
		super.handleTextMessage(session, message);
		TextMessage returnTextMessage = new TextMessage(message.getPayload() + "received at server");
		session.sendMessage(returnTextMessage);
	}
	

}
